pandas rename column values dictionary

41

df['col1'].map(di)       # note: if the dictionary does not exhaustively map all
                         # entries then non-matched entries are changed to NaNs
df['col1'].map(di).fillna(df['col1'])

Comments

Submit
0 Comments